package com.gdteam.kernel.httpserver;

import java.util.List;

import com.gdteam.kernel.Service;

public interface HttpServer extends Service {

    static String FQN = "com.gdteam.kernel.httpserver.httpserver";
    
    /**
     * Indicates if the http server is started. 
     * @return
     */
    boolean isStarted();
    
    /**
     * Indicates if the http server is stopped. 
     * @return
     */
    boolean isStopped();
    
    /**
     * Get the host port
     * @return
     */
    int getHostPort();
    
    /**
     * Get uris which are available in this http server
     * @return
     */
    List<String> getAvailableUris();
    
    /**
     * Deploy http application
     * @param application HttpApplication to deploy
     * @throws ApplicationNotSupportedException 
     */
    void deployApplication(HttpApplication application) throws ApplicationNotSupportedException;
    
    /**
     * Undeploy http application
     * @param applicationName The name of http application
     */
    void unDeployApplication(String applicationName);
    
    /**
     * Start http application
     * @param applicationName The name of http application
     */
    void startApplication(String applicationName);
    
    /**
     * Stop http application
     * @param applicationName The name of http application
     */
    void stopApplication(String applicationName);
    
}
